﻿using System.Windows.Controls;
using DALHelper.Business;

namespace ResortManager.Wizard
{
    /// <summary>
    /// Interaction logic for DefaultConfiguration1.xaml
    /// </summary>
    public partial class UTConfig1 : UserControl, IProceedureComponent
    {
        private pgRegister m_pgReg;

        public UTConfig1()
        {
            InitializeComponent();
            m_pgReg = new pgRegister();
            m_pgReg.KeepAlive = false;
            frmRegister.Navigate(m_pgReg);
            m_pgReg.Width = frmRegister.Width;
            m_pgReg.Height = frmRegister.Height;
        }

        #region IProceedureComponent Members

        public string KeyText
        {
            get { return "Cập nhật"; }
        }

        public bool RequestNext()
        {
            return true;
        }

        public void UpdateComponent()
        {
            if (ParentWizard != null && ParentWizard.WizardCommonData is Transaction)
            {
                m_pgReg.EditingTransaction = ParentWizard.WizardCommonData as Transaction;
                m_pgReg.IsEditing = true;
            }
        }

        public ProceedureDialog ParentWizard
        {
            get;
            set;
        }

        #endregion
    }
}
